<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>isXML</title>
</head>
<body>
	<script>
		//Sizzle, jQuery自带的选择器引擎
		var isXML = function(elem) {
		    var documentElement = elem && (elem.ownerDocument || elem).documentElement;
		    return documentElement ? documentElement.nodeName !== "HTML" : false;
		};
		console.log(isXML(document.getElementById("test")));  
		//false

		//但这样不严谨，因为XML的根节点，也可能是HTML标签，比如这样创建一个XML文档
		try {
		    var doc = document.implementation.createDocument(null, 'HTML', null);
		    console.log(doc.documentElement); 
		    //<html></html>
		    console.log(isXML(doc));  
		    //false
		} catch (e) {
		    console.log("不支持creatDocument方法");
		}
	</script>
</body>
</html>